<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>HMP系统  - 后台登录</title>
    <meta name="keywords" content="HMP系统 ,后台bootstrap框架,响应式后台">
    <meta name="description" content="HMP系统 ">
    <link rel="shortcut icon" href="favicon.ico"> 
    <link href="hmp/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="hmp/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="hmp/css/animate.css" rel="stylesheet">
    <link href="hmp/css/style.css?v=4.1.0" rel="stylesheet">
 
    <script>if(window.top !== window.self){ window.top.location = window.location;}</script>
</head>

<body class="gray-bg"  onkeydown="keyLogin()">

    <div class="middle-box text-center loginscreen  animated fadeInDown">
        <div>
            <div>
                <h1 class="logo-name">HP</h1>
            </div>
            <h3>欢迎使用 HMP系统</h3>

            <form class="m-t" role="form" method="post" action="login">
                <div class="form-group">
                    <input type="text" name="username"  id="username" class="form-control" placeholder="用户名" required="" value="wpsadmin">
                </div>
                <div class="form-group">
                    <input type="password" name="password"  id="password" class="form-control" placeholder="密码" required="" value="123">
                </div>
                <button type="button" id="loginBtn" class="btn btn-primary block full-width m-b" onclick="login()">登 录</button>
                <p class="text-muted text-center"> <a href="login.html#"><small>忘记密码了？</small></a> | <a href="/register">注册一个新账号</a>
                </p>
            </form>
            
        </div>
    </div>
	
 
</body>
	<!-- 全局js -->
	<script src="hmp/js/jquery.js"></script>
	<script src="hmp/js/bootstrap.min.js?v=3.3.6"></script>
	<script src="hmp/js/plugins/layer/layer.min.js"></script>
	<script type="text/javascript">
	
	function keyLogin(){
		 if (event.keyCode==13)  //回车键的键值为13
			 login();
		}
	
		//用户登陆 
	 function login(){
			 
			var username=$("#username").val();
			var password=$("#password").val();
		  	if(username=='')
		  	{
		  		layer.open({
		  		  title: '信息提示'
		  		  ,content: '用户名不能为空'
		  		});  
		  		return;
		  	}
		  	if(password=='')
		  	{
		  		layer.open({
		  		  title: '信息提示'
		  		  ,content: '密码不能为空'
		  		});  
		  		return;
		  	}
			var userjson={"username":username,"password":password}; 
			$.post("/user/login",userjson,function(data){
				
			 
				if(data.code!=200)
				{
					layer.open({
				  		  title: '信息提示'
				  		  ,content: data.msg
				  		});  
				  		return;
				}
				window.location.href="index";
				
			});
			
		};
	</script>

<!-- 爆炸效果  -->
<script type="text/javascript" src="/hmp/baoza/1.js"></script> 
<script>POWERMODE.colorful = true;POWERMODE.shake = false;document.body.addEventListener('input', POWERMODE);</script>

</html>
